from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import Integer
from sqlalchemy.orm import relationship
from __init__ import Base

class DashboardGroup(Base):

    __tablename__ = "dashboardgroup"

    dashboardid = Column(Integer, ForeignKey('dashboards.id'), primary_key=True)
    groupid = Column(Integer, ForeignKey('groups.id'), primary_key=True)

    group = relationship("Groups")

    def __init__(self, dashboardid, groupid):
        self.dashboardid = dashboardid
        self.groupid = groupid

    def __repr__(self):
        return "<DashboardGroup('%s', '%s')>" % (self.dashboardid, self.groupid)
